home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
allfiles
/
angry
/
main.dir
/
00007_Script_scrollerz
< prev
next >
Wrap
Text File
|
1999-03-01
|
2KB
|
68 lines
property pYLoc, pSpr, pNum
property pYOffset, pActive
property pOrigLoc
property pLastLoc
global bgSpr
on new me, thisSpr
set pSpr = thisSpr
set pNum = the memberNum of sprite(pSpr)
set pActive = TRUE
set pYLoc = the locV of sprite(pSpr)
set pYOffset = the locV of sprite(bgSpr) - the locV of sprite(pSpr)
set pOrigLoc = the loc of sprite(bgSpr) - the loc of sprite(pSpr)
puppetSprite pSpr, TRUE
return me
end
on resetLoc me
set the loc of sprite(pSpr) = the loc of sprite(bgSpr) - pOrigLoc
set pYLoc = the locV of sprite(pSpr)
if pYLoc <> 1000 then set pActive = TRUE
end
-- returning from other pages art will be in same loc as when user left.
on ReturnLoc me
set the locV of sprite(pSpr) to 2000
if pActive = TRUE then set the locV of sprite(pSpr) = pYLoc
put pYLoc into pLastLoc
set the locV of sprite(pSpr) = pLastLoc
updatestage
end
on scroll me, thisDir, thisSpeed
if the locV of sprite(pSpr) = 1000 then
set pYloc = 1000
set pActive = FALSE
end if
if pNum = name2Num("background") then -- background edge detection
set pYLoc = pYLoc + (thisSpeed * thisDir)
if pYLoc + ((the height of member pNum)/2) < 479 then
set pYLoc = 479 - ((the height of member pNum)/2)
else if pYloc - ((the height of member pNum)/2) > 1 then
set pYLoc = 1 + ((the height of member pNum)/2)
end if
else -- not the background, place in relation to background loc
if pActive then set pYloc = the locV of sprite(bgSpr) - pYOffset
end if
if the locV of sprite(pSpr) <> pYLoc then set the locV of sprite(pSpr) = pYLoc
end